package vip.liux.contracts.repositories.identity;

import org.springframework.data.repository.ListCrudRepository;
import org.springframework.data.repository.ListPagingAndSortingRepository;
import org.springframework.data.repository.NoRepositoryBean;
import vip.liux.contracts.models.identity.IdentityUser;
import vip.liux.users.IUserRepository;

import java.util.Optional;

@NoRepositoryBean
public interface IdentityUserRepository extends
        ListPagingAndSortingRepository<IdentityUser, Long>,
        ListCrudRepository<IdentityUser, Long>,
        IUserRepository<Long, IdentityUser> {

    Optional<IdentityUser> findByEmail(String email);

    Optional<IdentityUser> findByPhoneNumber(String phoneNumber);
}
